import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getxdemo_3/page/tzpage1.dart';
import 'package:getxdemo_3/page/tzpage2.dart';
import 'package:getxdemo_3/page/form1.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {

    return GetMaterialApp(
      title: 'Flutter Demo',
      initialRoute: '/',
      getPages: [
        GetPage(name: "/", page: () => MyApp()),
      ],
      home: Scaffold(
        appBar: AppBar(
          title: Text("GetX Title"),
        ),
        body: Center(
          child: Wrap(
            spacing: 10.0,
            children: [
              ElevatedButton(
                  onPressed: (){
                    Map<String,dynamic> m=new Map<String,dynamic>();
                    m['name']='塔睿';
                    m['age']=19;
                    Get.to(()=>TZPage1(),arguments:m);
                  },
                  child: Text("home")
              ),
              ElevatedButton(
                  onPressed: (){
                    Get.to(()=>FormPage1());
                  },
                  child: Text("表单页1")
              ),
            ],
          ),
        ),
      )
    );
  }
}